<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class CI_Locked_escort_entity{
	var $current_dbprefix = "";
	var $CI;
	var $escort_id = 0;
	var $locked_sex = "";
	var $locked_sexual_orientation = 0;
	var $locked_birth_date = 0;
	var $locked_language_ids = 0;
	var $locked_country = 0;
	var $locked_hair = 0;
	var $locked_eye = 0;
	var $locked_height = 0;
	var $locked_weight = 0;
	var $locked_measures = 0;
	var $locked_schedule = 0;
	var $locked_working_calendar = 0;
	var $locked_working_places = 0;
	var $locked_travel = 0;
	var $locked_serve_to = 0;
	var $locked_services = 0;
	var $locked_payment_method = 0;
	var $locked_pricing_time = 0;
	var $locked_extras = 0;
	var $locked_transport = "";
	var $locked_phone = 0;
	var $locked_email = "";
	var $locked_address = 0;
	var $locked_geolocation = "";
	var $locked_map = 0;
	var $locked_profession = 0;
	//var $locked_breasts_size = 0;
	//var $locked_penis_size = 0;
	var $locked_borncountry = 0;
	
	function __construct() {
		$this->CI = &get_instance();
		$this->current_dbprefix = $this->CI->db->dbprefix;
		$this->CI->db->set_dbprefix('default_');
	}
	function __destruct() {
		$this->CI->db->set_dbprefix($this->current_dbprefix);
	}
	
	function init($cmd, $input)
	{
		$this->CI->db->set_dbprefix('default_');
		
		if($cmd == 'escort_id')
		{
			$result = $this->CI->db->where('escort_id',$input)->get(TBL_LOCKED_ESCORT)->result();
		}
		else
		{
			return false;
		}
		
		if( !empty($result) )
		{
			$this->escort_id = $result[0]->escort_id;
			$this->locked_sex = $result[0]->locked_sex;
			$this->locked_sexual_orientation = $result[0]->locked_sexual_orientation;
			$this->locked_birth_date = $result[0]->locked_birth_date;
			$this->locked_language_ids = $result[0]->locked_language_ids;
			$this->locked_country = $result[0]->locked_country;
			$this->locked_hair = $result[0]->locked_hair;
			$this->locked_eye = $result[0]->locked_eye;
			$this->locked_height = $result[0]->locked_height;
			$this->locked_weight = $result[0]->locked_weight;
			$this->locked_measures = $result[0]->locked_measures;
			$this->locked_schedule = $result[0]->locked_schedule;
			$this->locked_working_calendar = $result[0]->locked_working_calendar;
			$this->locked_working_places = $result[0]->locked_working_places;
			$this->locked_travel = $result[0]->locked_travel;
			$this->locked_serve_to = $result[0]->locked_serve_to;
		 	$this->locked_services = $result[0]->locked_services;
			$this->locked_payment_method = $result[0]->locked_payment_method;
			$this->locked_pricing_time = $result[0]->locked_pricing_time;
			$this->locked_extras = $result[0]->locked_extras;
			$this->locked_transport = $result[0]->locked_transport;
			$this->locked_phone = $result[0]->locked_phone;
			$this->locked_email = $result[0]->locked_email;
			$this->locked_address = $result[0]->locked_address;
			$this->locked_geolocation = $result[0]->locked_geolocation;
			$this->locked_map = $result[0]->locked_map;	
			$this->locked_profession = $result[0]->locked_profession;
			//$this->locked_breasts_size = $result[0]->locked_breasts_size;
			//$this->locked_penis_size = $result[0]->locked_penis_size;	
			$this->locked_borncountry = $result[0]->locked_borncountry;
			
			return $this;
		}
		return false;
	}
	
	function setEscortId($input){ $this->escort_id=$input;}
	function setLockedSex($input){ $this->locked_sex=$input;}
	function setLockedSexualOrientation($input){ $this->locked_sexual_orientation=$input;}
	function setLockedBirthDate($input){ $this->locked_birth_date=$input;}
	function setLockedLanguageIds($input){ $this->locked_language_ids=$input;}
	function setLockedCountry($input){ $this->locked_country=$input;}
	function setLockedHair($input){ $this->locked_hair=$input;}
	function setLockedEye($input){ $this->locked_eye=$input;}
	function setLockedHeight($input){ $this->locked_height=$input;}
	function setLockedWeight($input){ $this->locked_weight=$input;}
	function setLockedMeasures($input){ $this->locked_measures=$input;}
	function setLockedSchedule($input){ $this->locked_schedule=$input;}
	function setLockedWorkingCalendar($input){ $this->locked_working_calendar=$input;}
	function setLockedWorkingPlaces($input){ $this->locked_working_places=$input;}
	function setLockedTravel($input){ $this->locked_travel=$input;}
	function setLockedServeTo($input){ $this->locked_serve_to=$input;}
	function setLockedServices($input){ $this->locked_services=$input;}
	function setLockedPaymentMethod($input){ $this->locked_payment_method=$input;}
	function setLockedPricingTime($input){ $this->locked_pricing_time=$input;}
	function setLockedExtras($input){ $this->locked_extras=$input;}
	function setLockedTransport($input){ $this->locked_transport=$input;}
	function setLockedPhone($input){ $this->locked_phone=$input;}
	function setLockedEmail($input){ $this->locked_email=$input;}
	function setLockedAddress($input){ $this->locked_address=$input;}
	function setLockedGeolocation($input){ $this->locked_geolocation=$input;}
	function setLockedMap($input){ $this->locked_map=$input;}
	function setLockedProfession($input){ $this->locked_profession=$input;}
	//function setLockedBreastsSize($input){ $this->locked_breasts_size=$input; }
	//function setLockedPenisSize($input){ $this->locked_penis_size=$input; }
	function setLockedBornCountry($input){ $this->locked_borncountry = $input; }
	
	function getEscortId(){ return $this->escort_id;}
	function getLockedSex(){ return $this->locked_sex;}
	function getLockedSexualOrientation(){ return $this->locked_sexual_orientation;}
	function getLockedBirthDate(){ return $this->locked_birth_date;}
	function getLockedLanguageIds(){ return $this->locked_language_ids;}
	function getLockedCountry(){ return $this->locked_country;}
	function getLockedHair(){ return $this->locked_hair;}
	function getLockedEye(){ return $this->locked_eye;}
	function getLockedHeight(){ return $this->locked_height;}
	function getLockedWeight(){ return $this->locked_weight;}
	function getLockedMeasures(){ return $this->locked_measures;}
	function getLockedSchedule(){ return $this->locked_schedule;}
	function getLockedWorkingCalendar(){ return $this->locked_working_calendar 	;}
	function getLockedWorkingPlaces(){ return $this->locked_working_places;}
	function getLockedTravel(){ return $this->locked_travel;}
	function getLockedServe_to(){ return $this->locked_serve_to;}
	function getLockedServices(){ return $this->locked_services;}
	function getLockedPaymentMethod(){ return $this->locked_payment_method;}
	function getLockedPricingTime(){ return $this->locked_pricing_time;}
	function getLockedExtras(){ return $this->locked_extras;}
	function getLockedTransport(){ return $this->locked_transport;}
	function getLockedPhone(){ return $this->locked_phone;}
	function getLockedEmail(){ return $this->locked_email;}
	function getLockedAddress(){ return $this->locked_address;}
	function getLockedGeolocation(){ return $this->locked_geolocation;}
	function getLockedMap(){ return $this->locked_map;}
	function getLockedProfession(){ return $this->locked_profession;}
	//function getLockedBreastsSize(){ return $this->locked_breasts_size; }
	//function getLockedPenisSize(){ return $this->locked_penis_size; }
	function getLockedBornCountry(){ return $this->locked_borncountry; }
	
	function update()
	{
		$this->CI->db->set_dbprefix('default_');
		
		$this->CI->db->set('locked_sex', $this->locked_sex);
		$this->CI->db->set('locked_sexual_orientation', $this->locked_sexual_orientation);
		$this->CI->db->set('locked_birth_date', $this->locked_birth_date);
		$this->CI->db->set('locked_language_ids', $this->locked_language_ids);
		$this->CI->db->set('locked_country', $this->locked_country);
		$this->CI->db->set('locked_hair', $this->locked_hair);
		$this->CI->db->set('locked_eye', $this->locked_eye);
		$this->CI->db->set('locked_height', $this->locked_height);
		$this->CI->db->set('locked_weight', $this->locked_weight);
		$this->CI->db->set('locked_measures', $this->locked_measures);
		$this->CI->db->set('locked_schedule', $this->locked_schedule);
		$this->CI->db->set('locked_working_calendar', $this->locked_working_calendar);
		$this->CI->db->set('locked_working_places', $this->locked_working_places);
		$this->CI->db->set('locked_travel', $this->locked_travel);
		$this->CI->db->set('locked_serve_to', $this->locked_serve_to);
		$this->CI->db->set('locked_services', $this->locked_services);
		$this->CI->db->set('locked_payment_method', $this->locked_payment_method);
		$this->CI->db->set('locked_pricing_time', $this->locked_pricing_time);
		$this->CI->db->set('locked_extras', $this->locked_extras);
		$this->CI->db->set('locked_transport', $this->locked_transport);
		$this->CI->db->set('locked_phone', $this->locked_phone);
		$this->CI->db->set('locked_email', $this->locked_email);
		$this->CI->db->set('locked_address', $this->locked_address);
		$this->CI->db->set('locked_geolocation', $this->locked_geolocation);
		$this->CI->db->set('locked_map', $this->locked_map);
		$this->CI->db->set('locked_profession', $this->locked_profession);
		//$this->CI->db->set('locked_breasts_size', $this->locked_breasts_size);
		//$this->CI->db->set('locked_penis_size', $this->locked_penis_size);
		$this->CI->db->set('locked_borncountry', $this->locked_borncountry);
		
		$this->CI->db->where('escort_id', $this->escort_id)->update(TBL_LOCKED_ESCORT);
	}
	
	function createNewLockedEscortEntity($escort_id){
		$this->CI->db->set_dbprefix('default_');
		
		$result = $this->CI->db->where('escort_id',$escort_id)->get(TBL_LOCKED_ESCORT)->result();
		if(!empty($result)) return ;
		
		$this->CI->db->set('escort_id', $escort_id );
		$this->CI->db->insert(TBL_LOCKED_ESCORT);
	}
//end class
}	